package com.bwda.dsrs.systemservice.domain.form.adminlog;


import com.bwda.dsrs.base.centerbase.form.BaseQueryForm;
import com.bwda.dsrs.base.util.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;
/**
 * 管理日志查询表单
 *
 * @author yanyuemei
 * @date 2019/4/27
 */
@Data
@ApiModel(description = "系统日志，登录，部门组织机构等模块的日志")
public class AdminLogQueryForm extends BaseQueryForm {

    @ApiModelProperty(value = "ID")
    private Integer id;

    @ApiModelProperty(value = "ID列表")
    private List<Integer> idList;

    @ApiModelProperty(value = "用户编号")
    private String userCode;

    @ApiModelProperty(value = "用户姓名")
    private String userName;

    @ApiModelProperty(value = "组织ID")
    private Integer orgId;

    @ApiModelProperty(value = "组织名称")
    private String orgName;

    @ApiModelProperty(value = "IP地址")
    private String ipAddr;

    @ApiModelProperty(value = "访问客户端标识")
    private String userAgent;

    @ApiModelProperty(value = "请求URI")
    private String requestUri;

    @ApiModelProperty(value = "请求方式get,post")
    private String method;

    @ApiModelProperty(value = "访问参数")
    private String params;

    @ApiModelProperty(value = "请求内容")
    private String requestContent;

    @ApiModelProperty(value = "结果")
    private String result;

    @ApiModelProperty(value = "0系统日志，1同步日志，2三方接口，3....")
    private Integer logType;

    @ApiModelProperty(value = "异常信息")
    private String exceptionMsg;

    @ApiModelProperty(value = "登录token")
    private String loginToken;

    @DateTimeFormat(pattern = DateUtil.FORMAT)
    @ApiModelProperty(value = "开始时间")
    private Date startTime;

    @DateTimeFormat(pattern = DateUtil.FORMAT)
    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    public Date getStartTime() {
        if (startTime != null){
            return (Date) startTime.clone();
        }

        return null;
    }

    public void setStartTime(Date startTime) {
        if (startTime != null){
            this.startTime = (Date) startTime.clone();
        }
    }

    public Date getEndTime() {
        if (endTime != null){
            return (Date) endTime.clone();
        }

        return null;
    }

    public void setEndTime(Date endTime) {
        if (endTime != null){
            this.endTime = (Date) endTime.clone();
        }
    }
}